home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_10_05 / 1005048b < prev    next >
Text File  |  1992-03-09  |  396b  |  18 lines

  1. Listing 2. Code for a simple filter
  2.           
  3.           void simple_filter(double *x, double *y, int N,
  4.           double a, double b)
  5.           {
  6.               double y0 = 0, y1 = 0;
  7.               int i = 0;
  8.           
  9.               for(; i < N; i++)
  10.               {
  11.                  y[i] = a*y0 + b*y1 + x[i];
  12.                  y1 = y0;
  13.                  y0 = y[i];
  14.               }
  15.           }
  16.  
  17.  
  18.